package monte;

/**
 * 战斗结果类
 */
public class BattleResult {
    Team teamA;
    Team teamB;
    Team winner;

    /**
     * 战斗结果类的构造函数
     *
     * @param teamA 战斗的队伍A
     * @param teamB 战斗的队伍B
     */
    public BattleResult(Team teamA, Team teamB) {
        this.teamA = teamA;
        this.teamB = teamB;
    }

    /**
     * 记录下一次战斗的胜者，即获胜队伍
     *
     * @param team 获胜队伍
     */
    public void setWinner(Team team) {
        winner = team;
    }

    public Team getTeamA() {
        return teamA;
    }

    public Team getTeamB() {
        return teamB;
    }

    public Team getWinner() {
        return winner;
    }

    @Override
    public String toString() {
        return "BattleResult{" +
                "teamA=" + teamA.getName() +
                ", teamB=" + teamB.getName() +
                ", winner=" + winner.getName() +
                '}';
    }
}
